import React from 'react';
import { Form, Alert } from 'antd';
import CodeMirror from 'src/components/ScriptEditor';

const SqlSet = (props) => {
  const { form, value } = props;
  const { getFieldDecorator } = form;
  const layout = {
    labelCol: {
      span: 6,
    },
    wrapperCol: {
      span: 18,
    },
  };
  return (
    <>
      <Form.Item label='SQL配置' {...layout}>
        {getFieldDecorator('sqlStatement', {
          initialValue: value.sqlStatement,
        })(<CodeMirror />)}
      </Form.Item>
      <Alert
        message={'说明:SQL语法需要与入参和返回结果匹配。字段使用#{}格式语法，eg:#{param}'}
        type='info'
        style={{ marginBottom: '20px' }}
      />
    </>
  );
};
export default SqlSet;
